﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'U' AND name = 'Activity')
	BEGIN
		DROP  Table Activity
	END
GO

CREATE TABLE Activity
(
   ActivityId int identity(1,1) not null,
   AccountId int not null,
   BodyId int null,
   ActivityDate datetime not null,
   Title nvarchar (256) not null,
   Description nvarchar(256) null
   
   constraint pkActivity primary key (ActivityId),
   constraint fkActivityToAccount foreign key (AccountId) references Account (AccountId),
   constraint fkOptionalActivityToBody foreign key (BodyId) references Body (BodyId)
)
GO  